import { reactive, ref } from 'vue';

export default function useUser() {
    const addRoleVisibile = ref(false);
    const secondVisibile = ref(false)
    const title = ref("")
    const dialogType = ref(0)
    const roleFormRef = ref();
    const refData = reactive({
        dom: roleFormRef.value
    })
    const addRoleForm = ref({
        name: '',
        description: '',
        permIds: [] as number[],
    });
    const isDisabled = ref(false)
    const checkall = ref(false)
    const indeterminate = ref(false)
    // 新建点击
    const handeleAddRoleClick = () => {
        // getMarkValidList();
        title.value = "新建角色"
        dialogType.value = 1
        isDisabled.value = false;
        addRoleVisibile.value = true;
    };

    return {
        addRoleVisibile,
        addRoleForm,
        roleFormRef: refData,
        title,
        checkall,
        indeterminate,
        isDisabled,
        dialogType,
        secondVisibile,
        handeleAddRoleClick
    }
}